# Contributor: Leon Marz <lmarz@cs.uni-frankfurt.de>
# Maintainer: Leon Marz <lmarz@cs.uni-frankfurt.de>
pkgname=ptex
pkgver=2.3.2
pkgrel=0
pkgdesc="texture mapping system by Walt Disney Animation Studios"
url="https://ptex.us"
arch="all !s390x !mips !mips64" # tests fail on s390x
license="BSD-3-Clause"
makedepends="cmake doxygen graphviz zlib-dev"
subpackages="$pkgname-static $pkgname-dev $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/wdas/ptex/archive/v$pkgver.tar.gz"

build() {
	cmake -B build \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=None \
		-DPTEX_VER=$pkgver \
		.
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

sha512sums="dbc557dc5e1761204ee3483af9bf4ff1504cbd7955e0405dc27a51f7182e2445e41db086b2792c2491aa2cbaddc74e523170a4b3d25e44d332123d5b7081f4b9  ptex-2.3.2.tar.gz"
